/**
 * @author lulongwen
 * Date: 2023-08-28 21:32
 * Description:
 */

// import React from 'react';
import { getStraightPath } from 'reactflow';

function CustomConnectionLine(props: any) {
  const { fromX, fromY, toX, toY, connectionLineStyle } = props;

  const [edgePath] = getStraightPath({
    sourceX: fromX,
    sourceY: fromY,
    targetX: toX,
    targetY: toY,
  });

  return (
    <g>
      <path style={connectionLineStyle} fill='none' d={edgePath} />
      <circle cx={toX} cy={toY} fill='black' r={3} stroke='black' strokeWidth={1.5} />
    </g>
  );
}

export default CustomConnectionLine;
